<html>

<head>
<title>Swing Application Window Wizard</title>
<link href="../../../book.css" rel="stylesheet" type="text/css" />
</head>

<body>

<h1>Swing Application Window Wizard</h1>
<table border="0" cellpadding="0" cellspacing="0" width="720">
  <tr>
    <td>
        <img src="images/wizard_swing_application0.gif" align="left" hspace="10">The Swing <b>Application Window</b> wizard creates 
			a main class that instantiates and shows a top-level JFrame. The wizard can be
              selected from the drop down wizard menu or from the
              Eclipse <b>New</b> wizard.
              <p>To use the wizard, select the project source folder and package
              to contain the class. Then enter the class name and hit the <b>Finish</b>
              button.<p>&nbsp;</td>
  </tr>
  <tr>
    <td>
      <br>
		<img src="images/wizard_swing_application1.gif">&nbsp; <img src="images/wizard_swing_application2.gif"></td>
  </tr>
  <tr>
    <td>
      <p><br>
		The wizard generates the following code including a <b>main()</b> method.</p>
      <font SIZE="2" COLOR="#7f0055"><b>
		<blockquote>
			<p><font face="Courier">import</font></b></font><font face="Courier" SIZE="2"> 
		javax.swing.JFrame;<br>
			</font><br>
			<font SIZE="2" COLOR="#7f0055"><b><font face="Courier">public</font></b></font><font face="Courier"><font SIZE="2">
			</font><font SIZE="2" COLOR="#7f0055"><b>class</b></font></font><font face="Courier" SIZE="2"> 
		SwingApplicationWindow {</font><font face="Courier"><font SIZE="2" COLOR="#7f0055"><b><br>
&nbsp;&nbsp;&nbsp;
			private</b></font><font SIZE="2"> JFrame </font>
			<font SIZE="2" COLOR="#0000c0">frame</font></font><font face="Courier" SIZE="2">;<br>
			<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font face="Courier"><font SIZE="2" COLOR="#7f0055"><b>public</b></font><font SIZE="2">
			</font><font SIZE="2" COLOR="#7f0055"><b>static</b></font><font SIZE="2">
			</font><font SIZE="2" COLOR="#7f0055"><b>void</b></font></font><font face="Courier" SIZE="2"> 
			main(String[] args) {<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp; try</b></font><font face="Courier" SIZE="2"> 
				{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font>
			<font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font face="Courier" SIZE="2">SwingApplicationWindow window =
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>new</b></font><font face="Courier" SIZE="2"> 
					SwingApplicationWindow();<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font face="Courier" SIZE="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; window.</font><font face="Courier"><font SIZE="2" COLOR="#0000c0">frame</font><font SIZE="2">.setVisible(</font><font SIZE="2" COLOR="#7f0055"><b>true</b></font></font><font face="Courier" SIZE="2">);<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font face="Courier" SIZE="2">&nbsp;&nbsp;&nbsp; } </font>
			<font SIZE="2" COLOR="#7f0055" face="Courier"><b>catch</b></font><font face="Courier" SIZE="2"> 
				(Exception e) {<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font face="Courier" SIZE="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.printStackTrace();<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font face="Courier" SIZE="2">&nbsp;&nbsp;&nbsp; }<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font face="Courier" SIZE="2">}<br>
			<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp; public</b></font><font face="Courier" SIZE="2"> 
			SwingApplicationWindow() {<br>
&nbsp;&nbsp;&nbsp; </font><font SIZE="2" COLOR="#7f0055" face="Courier">
			<b>&nbsp;&nbsp;&nbsp; </b></font><font face="Courier" SIZE="2">initialize();<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font face="Courier" SIZE="2">}<br>
			<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font face="Courier"><font SIZE="2" COLOR="#7f0055"><b>private</b></font><font SIZE="2">
			</font><font SIZE="2" COLOR="#7f0055"><b>void</b></font></font><font face="Courier" SIZE="2"> 
			initialize() {<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font face="Courier"><font SIZE="2" COLOR="#0000c0">&nbsp;&nbsp;&nbsp;
				frame</font><font SIZE="2"> = </font>
			<font SIZE="2" COLOR="#7f0055"><b>new</b></font></font><font face="Courier" SIZE="2"> 
				JFrame();<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font SIZE="2" COLOR="#0000c0" face="Courier">&nbsp;&nbsp;&nbsp; frame</font><font face="Courier" SIZE="2">.setBounds(100, 
				100, 450, 300);<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font face="Courier"><font SIZE="2" COLOR="#0000c0">&nbsp;&nbsp;&nbsp;
				frame</font><font SIZE="2">.setDefaultCloseOperation(JFrame.</font><font SIZE="2" COLOR="#0000c0"><i>EXIT_ON_CLOSE</i></font></font><font face="Courier" SIZE="2">);<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font SIZE="2"><font face="Courier">}<br>
			}</font></p>
		</blockquote>
		</font>
      <p>When editing Swing Application Windows, all of the standard Swing layouts,
      containers, widgets and menus are available. Custom or third party
      controls may be added via the <b>
		<a href="../../../com.instantiations.designer.doc.user/html/userinterface/palette.html">Choose 
		Component</a></b> command. You may also
      preview your frame using different look and feels using the drop down look
      and feel list in the toolbar. </p>
    </td>
  </tr>
</table>
</body>
</html>
